﻿<KCtl:BasePhoneApplicationPage 
    xmlns:KCtl="clr-namespace:Kiva7.Controls"
    x:Class="Kiva7.Pages.CommentsPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls" 
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="PortraitOrLandscape" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480"
    shell:SystemTray.IsVisible="True" Loaded="PhoneApplicationPage_Loaded">

    <Grid x:Name="LayoutRoot" Background="Transparent">
         <!--Pivot Control-->
        <KCtl:OrientedPivot x:Name="Pivot" Title="{Binding Path=L.KivaJournalEntry, Source={StaticResource L}}" IsTabStop="False">
            <!--Pivot item one-->
            <controls:PivotItem Header="{Binding Path=L.Comments, Source={StaticResource L}}">
                <Grid>
                    <ProgressBar Visibility="{Binding IsLoaded, Converter={StaticResource booleanToNotVisibility}}" 
                     IsIndeterminate="{Binding IsLoaded, Converter={StaticResource notBooleanConverter}}" 
                     Style="{StaticResource CustomIndeterminateProgressBar}"
                     VerticalAlignment="Center" />

                    <ListBox x:Name="lbxJournalEntries" Margin="0,0,-12,0" 
              Background="{StaticResource KivaBackgroundBrush}"
             ItemsSource="{Binding Data}" 
             HorizontalContentAlignment="Stretch" 
             Visibility="{Binding IsLoaded, Converter={StaticResource booleanToVisibility}}">

                        <ListBox.ItemTemplate>

                            <DataTemplate>

                                <StackPanel Margin="0,0,0,18" Style="{StaticResource KivaListItemStyle}">

                                    <TextBlock Text="{Binding Author}" Style="{StaticResource KivaTextSmallStyle}"/>

                                    <TextBlock Text="{Binding Translation.Text, Converter={StaticResource tagStripperConverter}}" Style="{StaticResource KivaTextNormalStyle}" 
                               TextWrapping="Wrap" Margin="12,0,0,0"/>

                                    <StackPanel Orientation="Horizontal" >
                                        <TextBlock Text="{Binding Date, Converter={StaticResource toShortDate}}" 
                               Style="{StaticResource KivaTextSmallStyle}"/>

                                        <TextBlock Text="{Binding WhereAbouts}" Style="{StaticResource KivaTextSmallStyle}"/>
                                    </StackPanel>

                                </StackPanel>

                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                </Grid>
            </controls:PivotItem>
        </KCtl:OrientedPivot>
    </Grid>

</KCtl:BasePhoneApplicationPage>
